<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:62:"C:\wamp200\www\xgwnew/application/index\view\order\detail.html";i:1551424588;s:61:"C:\wamp200\www\xgwnew/application/index\view\public\base.html";i:1547453452;}*/ ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title><?php echo $title; ?></title>
<link rel="stylesheet" href="__PUBLIC__/xsd/css/mui.min.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/icons-extra.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/app.css?v1111121" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/bootstrap/bootstrap.min.css"/>

</head>
<!--/head-->
<body>
	<script src="__PUBLIC__/js/jquery.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" charset="utf-8"></script>
    <script type="text/javascript" src="https://apis.map.qq.com/tools/geolocation/min?key=QQ6BZ-24HC6-ZAXSZ-MTZAU-5MU2J-HEFEH&referer=鲜果屋"></script>
<script>
//alert("cc");
		  var geolocation = new qq.maps.Geolocation();
     var options = {timeout: 9000};
        var positionNum = 0;
	geolocation.getLocation(showPosition, showErr, options);
	
	function showPosition(position) {
		
            positionNum ++;
            document.getElementById("demo").innerHTML += "序号：" + positionNum;
            document.getElementById("demo").appendChild(document.createElement('pre')).innerHTML = JSON.stringify(position, null, 4);
            document.getElementById("pos-area").scrollTop = document.getElementById("pos-area").scrollHeight;
        };
 
        function showErr() {
            positionNum ++;
            document.getElementById("demo").innerHTML += "序号：" + positionNum;
            document.getElementById("demo").appendChild(document.createElement('p')).innerHTML = "定位失败！";
            document.getElementById("pos-area").scrollTop = document.getElementById("pos-area").scrollHeight;
        };

	
</script>

	<!--/header-->

<style>
.mui-table-view-cell p {
    margin-bottom: 0;
    font-size: 12px;
}
.mui-table-view .mui-media-object {
    line-height: 42px;
    max-width: 60px;
    height: 60px;
}
.mui-card-header {
    font-size: 14px;
    border-radius: 2px 2px 0 0;
        padding: 5px 10px;
}
.mui-h5, h5 {
     font-size: 12px;
    font-weight: 400;
    color: #8f8f94;
}
</style>

	<!--引入CSS-->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/plugs/webuploader-0.1.5/webuploader.css">

<!--引入JS-->
<script type="text/javascript" src="__PUBLIC__/plugs/webuploader-0.1.5/webuploader.js"></script>


<header class="mui-bar mui-bar-nav">
  <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  <h1 class="mui-title">订单详情</h1>
</header>
<div class="mui-content">
<div class="mui-card" >
    <div class="mui-card-header ">
        <div class="mui-ellipsis mui-col-xs-8">订单商品</div>
    </div>
    <ul class="mui-table-view mui-table-view-striped mui-table-view-condensed">
        <?php if(is_array($orderInfo['OrderShoplist']) || $orderInfo['OrderShoplist'] instanceof \think\Collection): $i = 0; $__LIST__ = $orderInfo['OrderShoplist'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
          <li class="mui-table-view-cell">
              <div class="mui-table"  style="font-size:12px;">
                  <div class="mui-table-cell mui-col-xs-8">
                      <?php echo $vo['good_name']; ?>
                      (<?php echo $vo['rule_name']; ?>)
                  </div>
                  <div class="mui-table-cell mui-col-xs-2 mui-text-right">
                      <span class="mui-h5">x<?php echo $vo['num']; ?></span>
                  </div>
                  <div class="mui-table-cell mui-col-xs-4 mui-text-right">
                      <span class="mui-h5">¥<?php echo $vo['num']*$vo['price']; ?></span>
                  </div>
              </div>
          </li>
        <?php endforeach; endif; else: echo "" ;endif; ?>

        <li class="mui-table-view-cell">
            <div class="mui-table"  style="font-size:12px;">
                <div class="mui-table-cell mui-col-xs-12">
                    商品总额:¥<?php echo $orderInfo['shop_price']; ?> <br />运费:¥<?php echo $orderInfo['freight']; ?> 运费补贴:¥<?php echo $orderInfo['subsidy']; ?> 优惠券:¥<?php echo get_table_field($orderInfo['coupon_id'],"id","price","CouponList"); ?> 余额:¥<?php echo $orderInfo['balance']; ?>
                    <br />实付：¥<?php echo $orderInfo['pay_price']; ?>
                </div>
            </div>
        </li>
    </ul>
</div>



<div class="mui-card" >
    <div class="mui-card-header ">
        <div class="mui-ellipsis mui-col-xs-8">订单图片</div>
    </div>
    <ul class="mui-table-view mui-table-view-striped mui-table-view-condensed">
        
          <li class="mui-table-view-cell">
            
            <div>
<div id="thelist" class="mui-media-object mui-pull-left"></div>
   	  	
 <div class="btns col-sm-2">
  <div class="picker">选择文件</div>
  <button id="ctlBtn" class="btn default-btn" data-bhid="" >开始上传</button>
 </div>
</div>
          </li>
      

        <li class="mui-table-view-cell">
           <li class="mui-table-view-cell mui-media">
            		

   <img class="mui-media-object mui-pull-left" src="<?php echo get_cover($orderInfo['cover_id'],'path','400x218'); ?>" data-preview-src="" data-preview-group="<?php echo $orderInfo['id']; ?>">
  <img class="mui-media-object mui-pull-left" src="<?php echo get_cover($orderInfo['ddimage'],'path','400x218'); ?>" data-preview-src="" data-preview-group="<?php echo $orderInfo['ddimage']; ?>">
</li>
        </li>
    </ul>
</div>



<div class="mui-card">
    <div class="mui-card-header ">
        <div class="mui-ellipsis mui-col-xs-8">配送信息</div>
    </div>
    <ul class="mui-table-view mui-table-view-striped mui-table-view-condensed">
        <li class="mui-table-view-cell">
            <div class="mui-table" style="font-size:12px;">
                <div class="mui-table-cell mui-col-xs-4">
                    收货人
                </div>
                <div class="mui-table-cell mui-col-xs-8 ">
                    <span class="mui-h5">
                      <?php echo $orderInfo['user_name']; ?>
                    </span>
                </div>
            </div>
        </li>
        <li class="mui-table-view-cell">
            <div class="mui-table" style="font-size:12px;">
                <div class="mui-table-cell mui-col-xs-4">
                    配送地址
                </div>
                <div class="mui-table-cell mui-col-xs-8 ">
                    <span class="mui-h5">
                      <?php echo $orderInfo['address']; ?>
                    </span>
                </div>
            </div>
        </li>
        <li class="mui-table-view-cell">
            <div class="mui-table" style="font-size:12px;">
                <div class="mui-table-cell mui-col-xs-4">
                    联系电话
                </div>
                <div class="mui-table-cell mui-col-xs-8 ">
                    <span class="mui-h5">
                      <?php echo $orderInfo['tel']; ?>
                    </span>
                </div>
            </div>
        </li>
        <li class="mui-table-view-cell">
            <div class="mui-table" style="font-size:12px;">
                <div class="mui-table-cell mui-col-xs-4">
                    指定配送时间
                </div>
                <div class="mui-table-cell mui-col-xs-8 ">
                    <span class="mui-h5">
                      <?php echo $orderInfo['group_time']; ?><?php echo $orderInfo['deliverytime']; ?>
                    </span>
                </div>
            </div>
        </li>
        <?php if(in_array(($orderInfo['buystatus']), explode(',',"3,4"))): ?>
          <li class="mui-table-view-cell">
              <div class="mui-table" style="font-size:12px;">
                  <div class="mui-table-cell mui-col-xs-4">
                      配送师傅
                  </div>
                  <div class="mui-table-cell mui-col-xs-8 ">
                      <span class="mui-h5">
                        <?php echo get_table_field($orderInfo['allot_person'],"id",'name','DeliveryPerson'); ?>
                      </span>
                  </div>
              </div>
          </li>
          <li class="mui-table-view-cell">
              <div class="mui-table" style="font-size:12px;">
                  <div class="mui-table-cell mui-col-xs-4">
                      师傅电话
                  </div>
                  <div class="mui-table-cell mui-col-xs-8 ">
                      <span class="mui-h5">
                        <?php echo get_table_field($orderInfo['allot_person'],"id",'tel','DeliveryPerson'); ?>
                      </span>
                  </div>
              </div>
          </li>
        <?php endif; ?>
    </ul>

    <script src="__PUBLIC__/xsd/js/clipboard.min.js"></script>
    <textarea id="foo"  style="     height: 10px;  margin-left: -1000px;margin-bottom: 0;"  >
      商品：<?php if(is_array($orderInfo['OrderShoplist']) || $orderInfo['OrderShoplist'] instanceof \think\Collection): $i = 0; $__LIST__ = $orderInfo['OrderShoplist'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><?php echo $vo['good_name']; ?>(<?php echo $vo['rule_name']; ?>) <?php endforeach; endif; else: echo "" ;endif; ?>
        收货人：<?php echo $orderInfo['user_name']; ?>
        收货电话：<?php echo $orderInfo['tel']; ?>
        配送地址:<?php echo $orderInfo['address']; ?>
        发货人：何新 15885108322
    </textarea>

    <button class="btn " data-clipboard-target="#foo" aria-label="复制成功！" style="margin: 0 auto;display: block;">复制配送信息</button><br />
    <script>
    //new Clipboard('.btn');
    var clipboard = new Clipboard('.btn');

    clipboard.on('success', function(e) {
    	var msg = e.trigger.getAttribute('aria-label');
      console.log(e);
    	alert(msg);

        e.clearSelection();
    });
    </script>
</div>


<div class="mui-card" >
    <div class="mui-card-header ">
        <div class="mui-ellipsis mui-col-xs-8">订单信息</div>
    </div>
    <ul class="mui-table-view mui-table-view-striped mui-table-view-condensed">
      <!--
      <li class="mui-table-view-cell">
          <div class="mui-table" style="font-size:12px;">
              <div class="mui-table-cell mui-col-xs-4">
                  订单编号
              </div>
              <div class="mui-table-cell mui-col-xs-8 ">
                  <span class="mui-h5">
                    <?php echo $orderInfo['out_trade_no']; ?>
                  </span>
              </div>
          </div>
      </li>
      <li class="mui-table-view-cell">
          <div class="mui-table" style="font-size:12px;">
              <div class="mui-table-cell mui-col-xs-4">
                  下单时间
              </div>
              <div class="mui-table-cell mui-col-xs-8 ">
                  <span class="mui-h5">
                    <?php echo $orderInfo['create_time']; ?>
                  </span>
              </div>
          </div>
      </li>
      <li class="mui-table-view-cell">
          <div class="mui-table" style="font-size:12px;">
              <div class="mui-table-cell mui-col-xs-4">
                  支付方式
              </div>
              <div class="mui-table-cell mui-col-xs-8 ">
                  <span class="mui-h5">
                    <?php echo parse_config_value($orderInfo['pay'],'pay'); ?>
                  </span>
              </div>
          </div>
      </li>
      <li class="mui-table-view-cell">
          <div class="mui-table" style="font-size:12px;">
              <div class="mui-table-cell mui-col-xs-4">
                  送货方式
              </div>
              <div class="mui-table-cell mui-col-xs-8 ">
                  <span class="mui-h5">
                    <?php echo parse_config_value($orderInfo['way'],'distribution'); ?>
                  </span>
                  <?php if($orderInfo['way'] == '2'): ?>
                  <p>自提地点：<?php echo $orderInfo['zt_address']; ?></p>
                  <p>站长电话：<?php echo get_table_field($orderInfo['zt_address'],"name","phone","delivery_arayacak"); ?></p>
                  <?php endif; ?>

              </div>
          </div>
      </li>
      
      -->
      
      
      <li class="mui-table-view-cell">
          <div class="mui-table" style="font-size:12px;">
              <div class="mui-table-cell mui-col-xs-4" style="    display: table-caption;">
                  备注信息
              </div>
              <div class="mui-table-cell mui-col-xs-8 ">
                  <span class="mui-h5">

                    <textarea name="remark" id="remark" data-id="<?php echo $orderInfo['id']; ?>" ><?php echo $orderInfo['remark']; ?></textarea>
                  </span>
              </div>
          </div>
      </li>
    </ul>
</div>



</div>



<!--/#footer-->



<script src="__PUBLIC__/js/bootstrap.js"></script>
<script src="__PUBLIC__/js/jquery.nanoscroller.min.js"></script>
<script src="__PUBLIC__/xsd/js/mui.min.js"></script>
<script src="__PUBLIC__/xsd/js/flexible.js"></script>
<script src="__PUBLIC__/xsd/js/template.js"></script>


<script>
  mui.init({
    swipeBack:true //启用右滑关闭功能
  });
  $('#scroll').height($(window).height()-44)

  $(function(){
    $("#remark").mouseleave(function(){
      var val =   $("#remark").val()
      var orderid =  $(this).attr('data-id');
      $.post("<?php echo url('index/order/editOrderInfo'); ?>", {'id': orderid, 'remark': val}, function(data) {
        mui.toast(data.msg)
      }, "json");
    });
  })


</script>

	<script type="text/javascript">
  $(function(){
  	
  	
  
  	//var ddbhid =  $(e.relatedTarget.outerHTML).attr('data-bhid');
  	
  	var ddbhid= $("#ctlBtn").attr("data-bhid");
  	

  	   $("#ctlBtn").click(function(){
  
    uploader.upload();
   })
 
 
   var uploader = WebUploader.create({
    // 选完文件后，是否自动上传。
    auto: false,
    // 文件接收服务端。
     server: '/index/goodshops/testimage?ddbhid='+ddbhid,
     // 选择文件的按钮。可选。
     // 内部根据当前运行是创建，可能是input元素，也可能是flash.
     pick: '.picker',
     // 不压缩image, 默认如果是jpeg，文件上传前会压缩一把再上传！
     resize: false,
     // 只允许选择图片文件。
     accept: {
      title: 'Images',
      extensions: 'gif,jpg,jpeg,bmp,png',
      mimeTypes: 'image/*'
     },
     /* fileSizeLimit :10, //验证文件总大小是否超出限制, 超出则不允许加入队列
     fileSingleSizeLimit :10,   //验证单个文件大小是否超出限制, 超出则不允许加入队列。 */
     duplicate :true //去重， 根据文件名字、文件大小和最后修改时间来生成hash Key.
 
    });
 
 
  // 当文件被加入队列之前触发，此事件的handler返回值为false，则此文件不会被添加进入队列。
   uploader.on( 'beforeFileQueued', function( file ) {
    // 限制图片数量
    img_length = $("#thelist img").length;
    if (img_length >= 1) {
    layer.msg("图片最多上传1张");
    return false;
    }
 
   });
 
  // 当有文件添加进来的时候
   uploader.on( 'fileQueued', function( file ) {
   var $li = $(
      '<div id="' + file.id + '" class="file-item thumbnail col-sm-3" style="width:60px;margin-left:10px;">' +
       '<img>' +      
      '</div>'
      ),
     $img = $li.find('img');
    // $list为容器jQuery实例
    $("#thelist"+ddbhid).append( $li );
    
    
    
    // 创建缩略图
    // 如果为非图片文件，可以不用调用此方法。
    // thumbnailWidth x thumbnailHeight 为 100 x 100
    uploader.makeThumb( file, function( error, src ) {
     if ( error ) {
      $img.replaceWith('<span>不能预览</span>');
      return;
     }
     $img.attr( 'src', src );
    }, 150, 150 );
 
   });
 
  // 文件上传成功，给item添加成功class, 用样式标记上传成功。
   uploader.on( 'uploadSuccess', function( file ) {
    $( '#'+file.id ).addClass('upload-state-done');
    var $li = $( '#'+file.id ),
     $done = $li.find('div.upload-state-done');
    // 避免重复创建
    if ( !$done.length ) {
    $done = $('<div class=""></div>').appendTo( $li );
    }
    $done.html('<font color="blue">上传成功</font>');
   });
 
  // 文件上传失败，显示上传出错。
   uploader.on( 'uploadError', function( file ) {
    var $li = $( '#'+file.id ),
     $error = $li.find('div.error');
    // 避免重复创建
    if ( !$error.length ) {
     $error = $('<div class="error"></div>').appendTo( $li );
    }
    $error.html('<font color="red">上传失败</font>');
   });
 

  })
 
  function deleteFile(obj) {
   $(obj).parent().remove();
  }
</script>

<?php if(!(empty(config('shop_hours')) || (config('shop_hours') instanceof \think\Collection && config('shop_hours')->isEmpty()))): ?>
<script>
  var time_range = function (beginTime, endTime) {
    var strb = beginTime.split (":");
    if (strb.length != 2) {
      return false;
    }

    var stre = endTime.split (":");
    if (stre.length != 2) {
      return false;
    }

    var b = new Date ();
    var e = new Date ();
    var n = new Date ();

    b.setHours (strb[0]);
    b.setMinutes (strb[1]);
    e.setHours (stre[0]);
    e.setMinutes (stre[1]);

    if (n.getTime () - b.getTime () > 0 && n.getTime () - e.getTime () < 0) {
      return true;
    } else {

      mui.alert("<?php echo config('shop_hours_message'); ?>", '公告');
      $('.mui-popup-buttons').html(' ')
      $('.mui-popup-inner').css('border-radius', '13px')
      return false;
    }
  }

  var shop_hours = "<?php echo config('shop_hours'); ?>";
  var hours_arr = shop_hours.split('-');
  time_range (hours_arr[0], hours_arr[1]);

</script>
<?php endif; if(config('is_rest') == '1'): ?>
<script>
mui.alert("<?php echo config('rest_message'); ?>", '公告');
$('.mui-popup-buttons').html(' ')
$('.mui-popup-inner').css('border-radius', '13px')
</script>
<?php endif; ?>



<script>
  $(function(){
    $('.subsc').click(function(){
      // $.get("<?php echo url('index/clearusersession'); ?>", function(data){
      //   if(data.code == 1){
      //     window.location.href = "http://mp.weixin.qq.com/s/-AzpDTU7eAD24-R5QUP0wg"
      //   }
      // })
      //cookie('goodsmodel_id', $model_id);
      <?php switch(cookie('goodsmodel_id')): case "1":case "2":case "21":case "22":case "3": ?>
            mui.alert("<img src=<?php echo get_cover(config('frankserviceimg'), 'path'); ?> style='width:100%;'>", '长按扫二维码');
        <?php break; endswitch; if(!(empty($contact_qc) || ($contact_qc instanceof \think\Collection && $contact_qc->isEmpty()))): ?>
            mui.alert('<img src="<?php echo $contact_qc; ?>" style="width:100%;">', '长按扫二维码');
      <?php endif; ?>
    })


    $('.endlimit').each(function(){
      var $this = $(this);
      var stime = $this.attr('data-endtime');
      var starttime = new Date(stime.replace(/-/g,"/"))
      setInterval(function () {
        var nowtime = new Date();
        var time = starttime - nowtime;
        if(time > 0){
          var day = parseInt(time / 1000 / 60 / 60 / 24);
          var hour = parseInt(time / 1000 / 60 / 60 % 24);
          var minute = parseInt(time / 1000 / 60 % 60);
          var seconds = parseInt(time / 1000 % 60);
          $this.html("距结束还有:<span style='color:red'>"+ day + "天" + hour + "小时" + minute + "分钟" + seconds + "秒</span>");
        }

      }, 1000);
    })

    $('.hidecartbtn').each(function(){
      var id = $(this).attr('data-id')
      $('.cartbtn'+id).hide();
    })


  })
</script>

 

 <!-- <?php if(empty(\think\Cookie::get('positioninit')) || (\think\Cookie::get('positioninit') instanceof \think\Collection && \think\Cookie::get('positioninit')->isEmpty())): ?>
 <script type="text/javascript" src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script>
 <script>
   $(function(){
    var geolocation = new qq.maps.Geolocation("QQ6BZ-24HC6-ZAXSZ-MTZAU-5MU2J-HEFEH", "鲜果屋");
     geolocation.getIpLocation(showPosition, showErr)

   })

   function showPosition(position) {
     console.log(1111);
     $.getJSON("<?php echo url('index/cart/changecookie'); ?>", {name: 'positioninit', 'val': position.lat+','+position.lng}, function(json, textStatus) {});
  };
   function showErr() {
     console.log('定位失败');
   };
 </script>
 <?php endif; ?> -->

</body>
</html>
